Component({
  data: {
    list: ["a", "b", "c"],
    result: ["a", "b"],
  },
  methods: {
    onChange(event: WechatMiniprogram.CustomEvent) {
      this.setData({
        result: event.detail as unknown as string[],
      });
    },

    toggle(event: WechatMiniprogram.CustomEvent) {
      const { index } = event.currentTarget.dataset;
      const checkbox = this.selectComponent(`.checkboxes-${index}`);
      checkbox.toggle();
    },

    noop() {},
  },
});
